<?php require 'Home/View/template/header.php'; ?>
<div class="container">
    <div class="row">
        <div class="list-group">
            <div class="page-header">
                <h2 class="text-center">房源<br><small/>来寻找你的爱巢吧</h2>
            </div>
                <table class="table table-hover">
                    <tr  class="alert alert-info" role="alert">
                        <div class="progress">
                            <div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="45" aria-valuemin="0" aria-valuemax="100" style="width: 100%">
                                <span class="sr-only"></span>
                            </div>
                        </div>
                        <th><span class="label label-primary">房屋地址</span></th>
                        <th><span class="label label-success">房屋面积</span></th>
                        <th><span class="label label-warning">房屋类型</span></th>
                        <th><span class="label label-info">所在区域</span></th>

                        <th><span class="label label-danger">状态</span></th>
                        <th class="text-center" width='80'><span class="label label-success">图片</span></th>
                        <th class="text-center"><span class="label label-default">操作</span></th>
                    </tr>
                    <?php
                    foreach ($data as $row) {
                        echo '<tr class="active">';
                        echo '<td >'.$row['address'].'</td>';
                        echo '<td >'.$row['area'].'平方米'.'</td>';
                        echo '<td >'.$row['housetype'].'</td>';
                        echo '<td>'.$row['region'].'</td>';

                        if($row['issale']=='0') {
                            echo '<td>未出租</td>';
                        }else if ($row['issale']=='1') {
                            echo '<td>已出租</td>';
                        }else if ($row['issale']=='2') {
                            echo '<td>未出售</td>';
                        }else if ($row['issale']=='3') {
                            echo '<td>已出售</td>';
                        }
                        echo '<td align="center"><img src=asset/images/'.$row['pic'].' width=60 height=80 alt="无头像"></td>';
                        echo '<td class="text-center"><a href="index.php?c=House&m=Housedetail&id='.$row['id'].'">查看</a></td>';
                        echo '</tr>';
                    }
                    echo '</table>';
                    $totalrows = count($data);
                    echo "<table align='center'><tr><td>共有{$totalrows}处房屋</td></tr></table>";
                    ?>
            </div>
        </div>
    </div>
<?php require 'Home/View/template/footer.php'; ?>